//
//  TGRightDock.m
//  GroupBuy
//
//  Created by wwj on 15/11/12.
//  Copyright © 2015年 wwj. All rights reserved.
//

#import "TGRightDock.h"

@interface TGRightDock ()
@property (weak, nonatomic) TGRightDockItem *dockItem;
@end
@implementation TGRightDock

+ (instancetype)rightDock{
    return [[NSBundle mainBundle] loadNibNamed:@"TGRightDock" owner:nil options:nil].lastObject;
}

-(void)awakeFromNib{
    [self onClickDockItem:[self viewWithTag:0]];
}

-(void)setFrame:(CGRect)frame{
    frame.size = self.frame.size;
    [super setFrame:frame];
}

- (IBAction)onClickDockItem:(TGRightDockItem *)dockItem {
    
    [_delegate didSelectItemWithDock:self from:_dockItem.tag to:dockItem.tag];
    
    _dockItem.enabled = YES;
    dockItem.enabled = NO;
    _dockItem = dockItem;
    [self bringSubviewToFront:dockItem];
}


@end

@implementation TGRightDockItem

-(void)setHighlighted:(BOOL)highlighted{}

@end